/*
 * Copyright 2008-2023 dexian.vip. All rights reserved.
 * Support: http://www.dexian.vip
 * License: http://www.dexian.vip/license
 */

package vip.dexian.admin.assembler;

import vip.dexian.admin.command.ProfileUpdateCommand;
import vip.dexian.admin.entity.Admin;
import vip.dexian.core.base.validation.BaseValidator;
import org.mapstruct.BeforeMapping;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;

/**
 * 管理员个人信息转 - 实体映射 Mapper
 *
 * @author 挺好的 2023年06月05日 08:45:00
 */
@Mapper (componentModel = "spring", builder = @Builder (disableBuilder = true))
public abstract class ProfileCommandAssembler extends BaseValidator {

    /**
     * 转换前的校验
     *
     * @param command
     */
    @BeforeMapping
    public void validation (ProfileUpdateCommand command) {
        super.validation(command);
    }


    /**
     * 将command转换为entity
     *
     * @param command
     *         指令
     *
     * @return {@link vip.dexian.admin.entity.Admin}
     */
    public abstract Admin toEntity (ProfileUpdateCommand command);

}
